Functions

float D[] int Flags[] int EFlags[] int ComboD[] int ComboC[] int ComboF[] int ComboI[] int ComboT[] int ComboS[] int MovingBlockX int MovingBlockY int MovingBlockCombo int MovingBlockCSet int UnderCombo int UnderCSet bool State[] int Door[] int RoomType int RoomData void TriggerSecrets bool Lit int Wavy int Quake void SetSideWarp void SetTileWarp void GetSideWarpDMap void GetSideWarpScreen void GetSideWarpType void GetTileWarpDMap void GetTileWarpScreen void GetTileWarpType int LayerMap int LayerScreen int NumItems item LoadItem item CreateItem ffc LoadFFC int NumNPCs npc LoadNPC npc CreateNPC int NumLWeapons lweapon LoadLWeapon lweapon CreateLWeapon int NumEWeapons eweapon LoadEWeapon eweapon CreateEWeapon bool isSolid void ClearSprites void Rectangle void Circle void Arc void Ellipse void Spline void Line void PutPixel void DrawTile void FastTile void DrawCombo void FastCombo void Message void DrawCharacter void DrawInteger void DrawString void Quad void Triangle void Quad3D void Quad3D void SetRenderTarget void DrawBitmap void DrawLayer void DrawScreen
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

Screen Functions and Variables Documentation

Functions and Properties

Return Type Function Information
floatD[]
Each screen has 8 general purpose registers for use by script
programmers. These values are recorded in the save file when the
player saves their game. Do with these as you will.
Note that these registers are tied to screen/DMap combinations.
Encountering the same screen in a different DMap will result in a
different D[] array.
intFlags[]
An array of ten integers containing the states of the flags in the
10 categories on the Screen Data tabs 1 and 2. Each flag is ORed into the
Flags[x] value, starting with the top flag as the smallest bit.
Use the SF_ constants as the array acces for this value, and the
GetScreenFlags function if you are not comfortable with binary.
This is read-only; while setting it is not syntactically incorrect, it does nothing.
intEFlags[]
An array of 3 integers containing the states of the flags in the
E.Flags tab of the Screen Data dialog. Each flag is ORed into the
EFlags[x] value, starting with the top flag as the smallest bit.
Use the SEF_ constants as the array acces for this value, and the
GetScreenEFlags function if you are not comfortable with binary.
This is read-only; while setting it is not syntactically incorrect, it does nothing.
intComboD[]
The combo ID of the ith combo on the screen, where i is the index
used to access this array. Combos are counted left to right, top to
bottom.
intComboC[]
The CSet of the tile used by the ith combo on the screen, where i is
the index used to access this array. Combos are counted left to right
top to bottom.
intComboF[]
The placed flag of the ith combo on the screen, where i is the index
used to access this array. Combos are counted left to right, top to
bottom. Use the CF_ constants in std.zh to set or compare these values.
intComboI[]
The inherent flag of the ith combo on the screen, where i is the index
used to access this array. Combos are counted left to right, top to
bottom. Use the CF_ constants in std.zh to set or compare these values.
intComboT[]
The combo type of the ith combo on the screen, where i is the index
used to access this array. Combos are counted left to right, top to
bottom. Use the CT_ constants in std.zh to set or compare these values.
intComboS[]
The walkability mask of the ith combo on the screen, where i is the
index used to access this array. Combos are counted left to right, top
to bottom. The least signficant bit is true if the top-left of the combo
is solid, the second-least signficant bit is true if the bottom-left
of the combo is is solid, the third-least significant bit is true if the
top-right of the combo is solid, and the fourth-least significant bit is
true if the bottom-right of the combo is solid.
intMovingBlockX
The X position of the current moving block. If there is no moving block
on the screen, it will be -1. This is read-only; while setting it is not
syntactically incorrect, it does nothing.
intMovingBlockY
The Y position of the current moving block. If there is no moving block
on the screen, it will be -1. This is read-only; while setting it is not
syntactically incorrect, it does nothing.
intMovingBlockCombo
The combo used by moving block. If there is no block moving, the value
is undefined.
intMovingBlockCSet
The CSet used by moving block. If there is no block moving, the value
is undefined.
intUnderCombo
The current screen's under combo.
intUnderCSet
The current screen's under CSet.
boolState[]
An array of miscellaneous status data associated with the current
screen.
Screen states involve such things as permanent screen secrets, the
status of lock blocks and treasure chest combos, and whether items have
been collected.
These values are recorded in the save file when the player saves their
game. Use the ST_ constants in std.zh as indices into this array.
intDoor[]
The door type for each of the four doors on a screen. Doors are counted
using the first four DIR_ constants in std.zh. Use the D_ constants in
std.zh to compare these values.
intRoomType
The type of room this screen is (Special Item, Bomb Upgrade, etc)
This is currently read-only.
Use the RT_* constants in std.zh
intRoomData
This is the data associated with the room type above. What it means depends
on the room type. For Special Item, it will be the item ID, for a Shop, it
will be the Shop Number, etc.
Basically, this is what's in the "Catch-all" menu item underneath Room Type.
If the room type has no data (eg, Ganon's room), this will be undefined.
voidTriggerSecrets()
Triggers screen secrets temporarily. Set Screen->State[ST_SECRET]
to true beforehand or afterward if you would like them to remain
permanent.
boolLit
Whether or not the screen is lit. Setting this variable will change the
lighting setting of the screen until you change screens.
intWavy
The time, in frames, that the 'wave' screen effect will be in effect.
This value is decremented once per frame. As the value of Wavy approaches 0
the intensity of the waves decreases.
intQuake
The time, in frames, that the screen will shake. This value is decremented
once per frame. As the value of Quake approaches 0, the intensity of the
screen shaking decreases.
voidSetSideWarp(int warp, int screen, int dmap, int type)
Sets the current screen's side warp 'warp' to the destination screen,
DMap and type. If any of the parameters screen, dmap or type are equal
to -1, they will remain unchanged. If warp is not between 0 and 3, the
function does nothing.
voidSetTileWarp(int warp, int screen, int dmap, int type)
Sets the current screen's tile warp 'warp' to the destination screen,
DMap and type. If any of the parameters screen, dmap or type are equal
to -1, they will remain unchanged. If warp is not between 0 and 3, the
function does nothing.
voidGetSideWarpDMap(int warp)
Returns the destination DMap of the given side warp on the current screen.
Returns -1 if warp is not between 0 and 3.
voidGetSideWarpScreen(int warp)
Returns the destination screen of the given side warp on the current
screen. Returns -1 if warp is not between 0 and 3.
voidGetSideWarpType(int warp)
Returns the warp type of the given side warp on the current screen.
Returns -1 if warp is not between 0 and 3.
voidGetTileWarpDMap(int warp)
Returns the destination DMap of the given tile warp on the current screen.
Returns -1 if warp is not between 0 and 3.
voidGetTileWarpScreen(int warp)
Returns the destination screen of the given tile warp on the current
screen. Returns -1 if warp is not between 0 and 3.
voidGetTileWarpType(int warp)
Returns the warp type of the given tile warp on the current screen.
Returns -1 if warp is not between 0 and 3.
intLayerMap(int n)
Returns the map of the screen currently being used as the nth layer.
Values of n less than 1 or greater than 6, or layers that are not set up,
returns -1.
intLayerScreen(int n)
Returns the number of the screen currently being used as the nth layer.
Values of n less than 1 or greater than 6, or layers that are not set up,
returns -1.
intNumItems()
Returns the number of items currently present on the screen. Screen
items, shop items, and items dropped by enemies are counted; Link's
weapons, such as lit bombs, or enemy weapons are not counted.
Note that this value is only correct up until the next call to
Waitframe().
itemLoadItem(int num)
Returns a pointer to the numth item on the current screen. The return
value is undefined unless 1 <= num <= NumItems().
itemCreateItem(int id)
Creates an item of the given type at (0,0). Use the I_ constants in
std.zh to pass into this method. The return value is a pointer to the
new item.
ffcLoadFFC(int num)
Returns a pointer to the numth FFC on the current screen. The return
value is undefined unless 1 <= num <= ffcs, where ffcs is the number
of FFCs active on the screen.
intNumNPCs()
Returns the number of NPCs (enemies and guys) on the screen.
Note that this value is only correct up until the next call to
Waitframe().
npcLoadNPC(int num)
Returns a pointer to the numth NPC on the current screen. The return
value is undefined unless 1 <= num <= NumNPCs().
npcCreateNPC(int id)
Creates an npc of the given type at (0,0). Use the NPC_ constants in
std.zh to pass into this method. The return value is a pointer to the
new NPC.
intNumLWeapons()
Returns the number of Link weapon projectiles currently present on the screen.
This includes things like Link's arrows, bombs, magic, etc. Note that this
value is only correct up until the next call of Waitframe()
lweaponLoadLWeapon(int num)
Returns a pointer to the numth lweapon on the current screen. The return
value is undefined unless 1 <= num <= NumLWeapons().
lweaponCreateLWeapon(int type)
Creates an lweapon of the given type at (0,0). Use the LW_ constants in
std.zh to pass into this method. The return value is a pointer to the
new lweapon.
intNumEWeapons()
Returns the number of Enemy weapon projectiles currently present on the screen.
This includes things like Enemy arrows, bombs, magic, etc. Note that this
value is only correct up until the next call of Waitframe()
eweaponLoadEWeapon(int num)
Returns a pointer to the numth eweapon on the current screen. The return
value is undefined unless 1 <= num <= NumEWeapons().
eweaponCreateEWeapon(int type)
Creates an eweapon of the given type at (0,0). Use the EW_ constants in
std.zh to pass into this method. The return value is a pointer to the
new lweapon.
boolisSolid(int x, int y)
Returns true if the screen position (x, y) is solid - that is, if it
is within the solid portion of a combo on layers 0, 1 or 2. If either
x or y exceed the screen's bounds, then it will return false.
It will also return false if the only applicable solid combo is a solid
water combo that has recently been 'dried' by the whistle.
voidClearSprites(int spritelist)
Clears all of a certain kind of sprite from the screen. Use the SL_
constants in std.zh to pass into this method.
*Please note:
For all draw primitives, if the quest rule 'Subscreen Appears Above Sprites' is set,passing the layer argument as 7 will allow drawing on top of the subscreen
voidRectangle(int layer, int x, int y, int x2, int y2, int color, float scale, int rx, int ry, int rangle, bool fill, int opacity)
Draws a rectangle on the specified layer of the current screen, using
(x,y) as the top-left corner and (x2,y2) as the bottom-right corner.
Then scales the rectangle uniformly about its center by the given
factor.
Lastly, a rotation, centered about the point (rx, ry), is performed
counterclockwise using an angle of rangle degrees.
A filled rectangle is drawn if fill is true; otherwise, this method
draws a wireframe.
The rectangle is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the rectangle will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidCircle(int layer, int x, int y, int radius, int color, float scale, int rx, int ry, int rangle, bool fill, int opacity)
Draws a circle on the specified layer of the current screen with
center (x,y) and radius scale*radius.
Then performs a rotation counterclockwise, centered about the point
(rx, ry), using an angle of rangle degrees.
A filled circle is drawn if fill is true; otherwise, this method
draws a wireframe.
The circle is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the circle will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidArc(int layer, int x, int y, int radius, int startangle, int endangle, int color, float scale, int rx, int ry, int rangle, bool closed, bool fill, int opacity)
Draws an arc of a circle on the specified layer of the current
screen. The circle in question has center (x,y) and radius
scale*radius.
The arc beings at startangle degrees counterclockwise from standard
position, and ends at endangle degress counterclockwise from standard
position. The behavior of this function is undefined unless
0 <= endangle-startangle < 360.
The arc is then rotated about the point (rx, ry) using an angle of
rangle radians.
If closed is true, a line is drawn from the center of the circle to
each endpoint of the arc, forming a sector of the circle. If fill
is also true, a filled sector is drawn instead.
The arc or sector is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the arc will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidEllipse(int layer, int x, int y, int xradius, int yradius, int color, float scale, int rx, int ry, int rangle, bool fill, int opacity)
Draws an ellipse on the specified layer of the current screen with
center (x,y), x-axis radius xradius, and y-axis radius yradius.
Then performs a rotation counterclockwise, centered about the point
(rx, ry), using an angle of rangle degrees.
A filled ellipse is drawn if fill is true; otherwise, this method
draws a wireframe.
The ellipse is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the ellipse will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidSpline(int layer, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int color, int opacity)
Draws a cardinal spline on the specified layer of the current screen
between (x1,y1) and (x4,y4)
The spline is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the ellipse will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidLine(int layer, int x, int y, int x2, int y2, int color, float scale, int rx, int ry, int rangle, int opacity)
Draws a line on the specified layer of the current screen between
(x,y) and (x2,y2).
Then scales the line uniformly by a factor of scale about the line's
midpoint.
Finally, performs a rotation counterclockwise, centered about the
point (rx, ry), using an angle of rangle degrees.
The line is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the line will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidPutPixel(int layer, int x, int y, int color, int rx, int ry, int rangle, int opacity)
Draws a raw pixel on the specified layer of the current screen
at (x,y).
Then performs a rotation counterclockwise, centered about the point
(rx, ry), using an angle of rangle degrees.
The point is drawn using the specified index into the entire
256-element palette: for instance, passing in a color of 17 would
use color 1 of cset 1.
Opacity controls how transparent the point will be. Values other
than OP_OPAQUE and OP_TRANS are currently undefined.
voidDrawTile(int layer, int x, int y, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity)
Draws a block of tiles on the specified layer of the current screen
starting at (x,y), using the specified cset.
Starting with the specified tile, this method copies a block of size
blockh x blockw from the tile sheet to the screen. This method's
behavior is undefined unless 1 <= blockh, blockw <= 20.
Scale specifies the actual size in pixels! So scale 1 would mean it is
only one pixel in size. To use the default sizes of block w,h you must
set xscale and yscale to -1. These values are not independant of one another
so you cannot set xscale and leave yscale at -1.
rx, ry : these work now, just like the other primitives.
rangle performs a rotation clockwise using an angle of rangle degrees.
Flip specifies how the tiles should be flipped when drawn:
0: No flip
1: Horizontal flip
2: Vertical flip
3: Both (180 degree rotation)
If transparency is true, the tiles' transparent regions will be
respected.
Opacity controls how transparent the solid portions of the tiles will
be. Values other than OP_OPAQUE and OP_TRANS are currently undefined.
voidFastTile(int layer, int x, int y, int tile, int cset, int opacity)
Optimized and simpler version of DrawTile()
Draws a single tile on the current screen much in the same way as DrawTile().
See DrawTile() for an explanation on what these arguments do.
voidDrawCombo(int layer, int x, int y, int combo, int w, int h, int cset, int xscale, int yscale, int rx, int ry, int rangle, int frame, int flip, bool transparency, int opacity)
Draws a combo on the specified layer of the current screen
starting at (x,y), using the specified cset.
Starting with the specified tile referenced by the combo
this method copies a block of size
blockh x blockw from the tile sheet to the screen. This method's
behavior is undefined unless 1 <= blockh, blockw <= 20.
Scale specifies the actual size in pixels! So scale 1 would mean it is
only one pixel in size. To use the default sizes of block w,h you must
set xscale and yscale to -1. These values are not independant of one another
so you cannot set xscale and leave yscale at -1.
rx, ry : works now :
rangle performs a rotation clockwise using an angle of rangle degrees.
Flip specifies how the tiles should be flipped when drawn:
0: No flip
1: Horizontal flip
2: Vertical flip
3: Both (180 degree rotation)
If transparency is true, the tiles' transparent regions will be
respected.
Opacity controls how transparent the solid portions of the tiles will
be. Values other than OP_OPAQUE and OP_TRANS are currently undefined.
voidFastCombo(int layer, int x, int y, int combo, int cset, int opacity)
Optimized and simpler version of DrawCombo()
Draws a single combo on the current screen much in the same way as DrawCombo().
See DrawCombo() for an explanation on what these arguments do.
voidMessage(int string)
Prints the message string with given ID onto the screen.
If string is 0, the currently displayed message is removed.
This method's behavior is undefined if string is less than 0
or greater than the total number of messages in the quest.
voidDrawCharacter(int layer, int x, int y, int font, int color, int background_color, int width, int height, int glyph, int opacity)
Draws a single ASCII character 'glyph' on the specified layer of the current screen
using the specified font index (see std.zh for FONT_* list to pass to this method)
starting at (x,y), using the specified color as the foreground color
and background_color as the background color. * NOTE * Use -1 for a transparent background.
The arguments width and height may be used to draw the glyph
of any arbitrary size begining at 1 pixel up to 512 pixels large. (more than four times the size of the screen)
Passing 0 or negative values to this will use the default fonts w and h.
Opacity controls how transparent the is.
Values other than OP_OPAQUE and OP_TRANS are currently undefined.
voidDrawInteger(int layer, int x, int y, int font, int color, int background_color, int width, int height, int number, int number_decimal_places, int opacity)
Draws a zscript 'int' or 'float' on the specified layer of the current screen
using the specified font index (see std.zh for FONT_* list to pass to this method)
starting at (x,y), using the specified color as the foreground color
and background_color as the background color. * NOTE * Use -1 for a transparent background.
The arguments width and height may be used to draw the number
of any arbitrary size begining at 1 pixel up to 512 pixels large.
Passing 0 or negative values to this will use the default fonts w and h.
The number can be rendered as type 'int' or 'float' by setting the argument
"number_decimal_places", which is only valid if set to 0 or <= 4.
Opacity controls how transparent the is.
Values other than OP_OPAQUE and OP_TRANS are currently undefined.
voidDrawString(int layer, int x, int y, int font, int color, int background_color, int format, int ptr[], int opacity)
Prints a NULL terminated string up to 256 characters from an int array
containing ASCII data (*ptr) on the specified layer of the current screen
using the specified font index (see std.zh for FONT_* list to pass to this method)
using the specified color as the foreground color
and background_color as the background color. * NOTE * Use -1 for a transparent background.
The array pointer should be passed as the argument for '*ptr', ie.
int string[] = "Example String"; Screen->DrawString(l,x,y,f,c,b_c,fo,o,string);
int format tells the engine how to format the string. (see std.zh for TF_* list to pass to this method)
Opacity controls how transparent the message is.
Values other than OP_OPAQUE and OP_TRANS are currently undefined.
(Psuedo) 3D drawing
voidQuad(int layer, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int w, int h, int cset, int flip, int texture, int render_mode)
Draws a quad on the specified layer with the corners x1,y1 through x4,y4.
Corners are drawn in a counterclockwise order starting from x1,y1. ( So
if you draw a "square" for example starting from the bottom-right corner
instead of the usual top-left, the the image will be textured onto the
quad so it appears upside-down. -yes, these are rotatable. )
From there a single or block of tiles or combos is then texture mapped
onto the quad using the arguments w, h, cset, flip, and render_mode.
A positive vale in texture will draw the image from the tilesheet pages
whereas a negative value will be drawn from the combo page. 0 will draw combo number 0.
Both w and h are undefined unless 1 <= blockh, blockw <= 16, and it is a power of
two. ie: 1, 2 are acceptable, but 2, 15 are not.

Flip specifies how the tiles/combos should be flipped when drawn:
0: No flip
1: Horizontal flip
2: Vertical flip
3: Both (180 degree rotation)
**See std.zh for a list of all available render_mode arguments.
voidTriangle(int layer, int x1, int y1, int x2, int y2, int x3, int y3, int w, int h, int cset, int flip, int texture, int render_mode)
Draws a triangle on the specified layer with the corners x1,y1 through x4,y4.
Corners are drawn in a counterclockwise order starting from x1,y1.
From there a single or block of tiles or combos is then texture mapped
onto the triangle using the arguments w, h, cset, flip, and render_mode.
A positive vale in texture will draw the image from the tilesheet pages
whereas a negative value will be drawn from the combo page. 0 will draw combo number 0.
Both w and h are undefined unless 1 <= blockh, blockw <= 16, and it is a power of
two. ie: 1, 2 are acceptable, but 2, 15 are not.
Flip specifies how the tiles/combos should be flipped when drawn:
0: No flip
1: Horizontal flip
2: Vertical flip
3: Both (180 degree rotation)
**See std.zh for a list of all available render_mode arguments.
voidQuad3D(int layer, int pos[], int uv[], int cset[], int size[], int flip, int texture, int render_mode)
Draws a Quad on the specified layer similar to Quad.
[12]pos - x, y, z positions of the 4 corners.
[8]uv - x, y texture coordinates of the given texture.
[4]csets - of the corners to interpolate between.
[2]size - w, h, of the texture.
**See std.zh for a list of all available render_mode arguments.
voidQuad3D(int layer, int pos[], int uv[], int cset[], int size[], int flip, int texture, int render_mode)
Draws a Quad on the specified layer similar to Quad.
[9]pos - x, y, z positions of the 4 corners.
[6]uv - x, y texture coordinates of the given texture.
[3]csets - of the corners to interpolate between.
[2]size - w, h, of the texture.
**See std.zh for a list of all available render_mode arguments.
Bitmap Drawing
voidSetRenderTarget(int bitmap_id)
Sets the target bitmap for all succesive drawing commands.
These can be directly to the screen or any one of the available off-screen bitmaps
which are generally categorized as -1(screen) or 0-bitmapNumber(off-screen).
**See std.zh for a complete list of valid render targets (RT_*).
voidDrawBitmap(int layer, int bitmap_id, int source_x, int source_y, int source_w, int source_h, int dest_x, int dest_y, int dest_w, int dest_h, float rotation, bool mask)
Draws a source rect from off-screen Bitmap with id of bitmap_id onto
an area of the screen described by dest rect at the given layer.
*Example:
Screen->Bitmap( 6, myBitmapId, 0, 0, 16, 16, 79, 57, 32, 32, 0, true );
Would draw a 16x16 area starting at the upper-left corner of source bitmap to
layer 6 of the current screen at coordinates 79,57 with a width and height of 32.
***NoteScript drawing functions are enqueued and executed in a frame-by-frame basis 
based on the order of which layer they need to be drawn to. Drawing to or from
seperate render tagets or bitmaps is no exception! So keep in mind in order to 
eliminate unwanted drawing orders or bugs.
Screen/Layer Drawing
voidDrawLayer(int layer, int source_map, int source_screen, int source_layer, int x, int y, float rotation, int opacity)
Draws an entire Layer from source_screen on source_map on the specified layer of the current screen at (x,y).
If rotation is not zero, it(the entire layer) will rotate about its center.
Opacity controls how transparent the solid portions of the tiles will
be. Values other than OP_OPAQUE and OP_TRANS are currently
undefined.
voidDrawScreen(int layer, int map, int source_screen, int x, int y, float rotation)
Draws an entire screen from screen on map on the specified layer of the current screen at (x,y).
If rotation is not zero, it(the entire screen) will rotate about its center.